import http from "@/api/request.js";

const bast_url = "/admin/employee/";

/**
 * 获取验证码
 * @param {*} data
 * @returns
 */
export const getSomeCodeImg = (data) => {
  return http({
    url: `${bast_url}captcha.jpg?uuid=${data.uuid}`,
    method: "get",
    responseType: "blob",
  });
};

/**
 * 登入
 * @param {*} data
 * @returns
 */
export const goToLogin = (data) => {
  return http({
    url: `${bast_url}login`,
    method: "post",
    data,
  });
};

/**
 * 退出登录
 */
export const goToLogOut = () => {
  return http({
    url: `${bast_url}logout`,
    method: "post",
  });
};

/**
 * 获取登入信息
 */
export const getUserInfo = () => {
  return http({
    url: `${bast_url}getuserinfo`,
    method: "get",
  });
};

/**
 * 修改密码
 */
export const changePassword = (data) => {
  return http({
    url: `${bast_url}changePassword`,
    method: "post",
    data,
  });
};

/**
 * 修改密码
 */
export const updateUser = (data) => {
  return http({
    url: `${bast_url}update`,
    method: "post",
    data,
  });
};
